{include 'public/header.html'}
<div class="main-content">

<script>window.UEDITOR_HOME_URL = '{$smarty.const.YD_URL}libraries/ueditor1_4_3_3-utf8-php/';</script>
<script>window.UEDITOR_SERVER_URL = '{$smarty.const.YD_URL}index.php?con=admin/index/ueditor';</script>
<script>window.UEDITOR_REMOVE_URL = '{$smarty.const.YD_URL}';</script>
<script type="text/javascript" charset="utf-8" src="{$smarty.const.YD_URL}libraries/ueditor1_4_3_3-utf8-php/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="{$smarty.const.YD_URL}libraries/ueditor1_4_3_3-utf8-php/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="{$smarty.const.YD_URL}libraries/ueditor1_4_3_3-utf8-php/lang/zh-cn/zh-cn.js"></script>
<script type="text/plain" id="j_ueditorupload" style="height:5px;display:none;"></script>
<script type="text/javascript" charset="utf-8" src="{$smarty.const.YD_URL}libraries/ueditor1_4_3_3-utf8-php/ueditor.upload.js"></script>

<div class="page-content">
  <div class="page-content-area" style="opacity: 0.8;"> <br>
    <div class="page-header">
      <h1> 通知公告 <small><i class="ace-icon fa fa-angle-double-right"></i> {if $row.id}编辑{else}新增{/if}通知 </small> </h1>
    </div>
    <div class="row">
      <div class="panel panel-default">
        <div class="panel-body table-responsive">
          <form method="post" class="form-horizontal" role="form" id="submitform" onsubmit="return false">
            <div class="form-group">
              <div class="col-md-6">
                <label class="control-label" for="name">标题</label>
                <input type="text" class="form-control" id="info" name="info" value="{$row.info}" required>
              </div>
            </div>            
            <div class="form-group">
              <div class="col-md-6">
                <label class="control-label" for="appsecret">时间</label>
                <input type="text" class="form-control" id="add_time" name="add_time" value="{if $row.add_time && $row.add_time != '0000-00-00 00:00:00'}{$row.add_time}{else}{formattime(time())}{/if}">
              </div>
            </div>            
            <div class="form-group">
              <div class="col-md-6">
                <button type="submit" class="btn btn-primary btn-lg btn-submit">提交</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
<script>
var isbusy = false;
$(function(){
	$('#submitform').validate({
		focusInvalid: true,
		rules: {
			//title: {
				//required: true
			//}
		}
	});
	$('.btn-submit').click(function(){
		if(!$('#submitform').valid())return false;
		if(isbusy)return false;
		isbusy = true;
		tooltipbox.show('正在执行操作...');
		$.post(location.href, $('#submitform').serialize(), function(res){
		    if(res.code == 1){
				location.href = '{siteurl("con=admin/notice")}';
			}
			tooltipbox.show(res.msg);	
			isbusy = false;
		}, 'json').error(function(a, b, c){
			tooltipbox.show('数据或网络错误');
			isbusy = false;
		});
	});
});
</script> 
{include 'public/footer.html'} 